<?
$tplFooter = new TplLoad;
$tplFooter->caching = false;
$catid = "";

if (isset($_REQUEST["catid"]))	{
	if ($_REQUEST["catid"]>0) {
		$catid = round($_REQUEST["catid"]);
	}
	
}
$lStr="footer_" . $_SESSION["la"];


if (!$tplFooter->is_cached("footer.tpl",$lStr))
{ 
	//addToHistory(16,"","",time());

	$string=getCategoriesDD($catid,0);
	
	if (isset($set_count_dynamic))
	{
		$str = "";
		$row = mysql_fetch_array(q("select count(ad_id),sum(ad_views) from $ads_tbl where 2>1 $val_string"));
		$upd_ads = $row["count(ad_id)"];
		$upd_ad_views = $row["sum(ad_views)"];
		$row = mysql_fetch_array(q("select count(user_id) from $usr_tbl"));
		$upd_users = $row["count(user_id)"];
		
		if (!$upd_ad_views)
			$upd_ad_views = 0;
		
		$la_s_bar = formatString(LA_S_BAR, array("$upd_users","$upd_ads","$upd_ad_views"));
		$tplFooter->assign("la_s_bar",$la_s_bar);
	}

	
	
// Build template fields
if (isset($url))
	$fArray["URL"] = $url;
else
	$fArray["URL"] = "";




if (isset($la_search))
	$fArray["LA_SEARCH"] = $la_search;
else
	$fArray["LA_SEARCH"] = "";
	
if (isset($la_s_category))
	$fArray["LA_S_CATEGORY"] = $la_s_category;
else
	$fArray["LA_S_CATEGORY"] = "";

if (isset($la_all))
	$fArray["LA_ALL"] = $la_all;
else
		$fArray["LA_ALL"] = "";

if (isset($string))
	$tplFooter->assign("dropdown_catlist",$string);

// Execute
//writeTemplate("footer",$fArray);
if (isset($t_start))
{
	$exec_time = array_sum(explode(' ', microtime())) - $t_start;
//echo ("Execution time is $exec_time seconds.");
}

$tplFooter->assign("LA_RSS_FEED_ALT", urlencode(LA_RSS_FEED));
$tplFooter->assign("LA_TERMS_ALT", urlencode(LA_TERMS));
$tplFooter->assign("LA_ABOUT_ALT", urlencode(LA_ABOUT));
$tplFooter->assign("LA_ADVERTISE_ALT", urlencode(LA_ADVERTISE));
$tplFooter->assign("LA_HELP_ALT", urlencode(LA_HELP));

$tplFooter->assign("LA_TERMS", strEnc(LA_TERMS));
$tplFooter->assign("LA_ABOUT", strEnc(LA_ABOUT));
$tplFooter->assign("CATID", $catid);
$tplFooter->assign("HAS_LIC", $set_li);
$tplFooter->assign("LA_ADVERTISE", LA_ADVERTISE);
$tplFooter->assign("LA_HELP", LA_HELP);
$tplFooter->assign("LA_RSS_FEED", LA_RSS_FEED);
$tplFooter->assign("SET_RSS", $set_rss_generate);
$tplFooter->assign("BEST_RATED", $best_rated);
$tplFooter->assign("MOST_VIEWED", $mostviewed);
$tplFooter->assign("SET_SITENAME", $set_sitename);
$tplFooter->assign("SET_URL", $set_url);
}

$tplFooter->display("footer.tpl",$lStr);
?>
